package com.example.demo.service;

import com.example.demo.exception.ServiceException;
import com.example.demo.param.vo.NewsArrVO;
import com.example.demo.param.vo.NewsVO;

public interface INewsService {
    /**
     * 新增消息
     * @param userId
     * @param newsContent
     * @return
     */
    Boolean insert(String id, String userId, String newsContent) throws ServiceException;

    /**
     * 新增公告
     * @param userId
     * @return
     */
    Boolean insertNotice(String title, String userId, String content) throws ServiceException;

    /**
     * 删除消息
     * @param id
     * @return
     * @throws ServiceException
     */
    Boolean delete(String id) throws  ServiceException;

    /**
     * 删除公告
     * @param id
     * @return
     * @throws ServiceException
     */
    Boolean deleteByNotice(String id) throws  ServiceException;

    /**
     * 修改消息
     * @param id
     * @param userId
     * @param newsTitle
     * @param newsContent
     * @return
     * @throws ServiceException
     */
    Boolean update(String id, String userId, String newsTitle, String newsContent)throws ServiceException;

    /**
     * 获取单条消息详情
     * @param id
     * @return
     * @throws ServiceException
     */
    NewsVO getById(String id) throws ServiceException;

    /**
     * 获取我的所有消息
     * @param userId
     * @param newsTitle
     * @param newsContent
     * @param page
     * @param pageSize
     * @return
     */
    NewsArrVO getQueryPage(String userId, String newsTitle, String newsContent, Integer page, Integer pageSize) throws ServiceException;
}
